<template>
	<view class="">
		<u-swiper :list="info.images_text" height='1000' autoplay></u-swiper>
		<view class="title">
			{{info.title || ''}}
		</view>

		<view class="content" v-html="text">

		</view>
	</view>
</template>

<script>
	import parse from 'mini-html-parser2'
	export default {
		data() {
			return {
				info: {},
				richtext: '<p>你好</p>',
				text: ''
			}
		},
		onLoad(e) {
			this.getinfo(e.id)
		},
		methods: {

			getinfo(id) {
				this.$http('user.Article', {
					id
				}).then(res => {
					if (res.code == 1) {

						this.info = res.data.item
						console.log(this.info);


						this.richtext = res.data.item.content
						// #ifdef MP-ALIPAY
						parse(this.richtext, (err, htmlData) => {
							if (!err) {
								this.text = htmlData
							}
						})

						//  #endif


						// #ifdef H5 || APP-PLUS
						// this.text = res.data.content
						this.text = res.data.item.content


						//  #endif


					}
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.title {
		font-size: 38rpx;
		font-weight: 700;
		padding: 40rpx 20rpx;
	}

	.content {
		padding: 0 20rpx;
	}
</style>
